package com.cy.dao;

import com.cy.entity.Director;
import com.cy.entity.Movie;
import com.cy.entity.Star;
import com.cy.entity.Tj;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface MDao {
    List<Movie> list(Tj tj);
    @Delete("delete from movie where id = #{id}")
    void del(Integer id);
    @Delete("delete from mid where mid = #{id}")
    void delMid(Integer id);
    @Select("select * from director")
    List<Director> dir();
    void insert(Movie movie);
    @Select("select id from star where name=#{name} and card=#{card}")
    Integer sel(Star star);
    @Insert("insert into mid values(#{id},#{i})")
    void insertMid(@Param("id") Integer id,@Param("i") int i);

    void insertStar(Star star);

    Movie selMovie(Integer id);
    @Update("update movie set name=#{name},date=#{date},price=#{price},content=#{content},pic=#{pic},did=#{did} where id=#{id}")
    void update(Movie movie);
}
